<template>
  <div class="app-container">
    <!--<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="姓名" prop="realName">
        <el-input
          v-model="queryParams.realName"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职工号" prop="jobNumber">
        <el-input
          v-model="queryParams.jobNumber"
          placeholder="请输入职工号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>-->

    <template>
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane :label="'入会申请 ('+ total+')'" name="0" v-if="checkPermi(['business:appMembership:list'])">
          <el-table v-loading="loading" :data="medicalFeeQueryList" @selection-change="handleSelectionChange">
            <el-table-column label="姓名" align="center" prop="params.realName" />
            <el-table-column label="工号" align="center" prop="params.jobNumber" />
            <el-table-column label="工会" align="center" prop="params.deptName" />
            <el-table-column label="审核状态" align="center" prop="params.statusName" />
            <el-table-column label="申请时间" align="center" prop="createTime" />
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-set-up"
                  @click="audit0(scope.row)"
                  v-hasPermi="['business:appMembership:auditSecondLaborUnion']"
                  v-if="scope.row.status =='0'"
                >二级工会审核</el-button>
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-s-check"
                  @click="audit0_1(scope.row)"
                  v-hasPermi="['business:appMembership:auditFundCommittee']"
                  v-if="scope.row.status =='2'"
                >基金管委会审核</el-button>
              </template>
            </el-table-column>
          </el-table>
          <pagination
            v-show="total>0"
            :total="total"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getAppMembership"
          />
        </el-tab-pane>

        <el-tab-pane  :label="'退会申请 ('+ totalAppWithdrawal+')'" name="1" v-if="checkPermi(['business:appWithdrawal:list'])">
          <el-table v-loading="loading" :data="appWithdrawalList" @selection-change="handleSelectionChange">
            <!--<el-table-column type="selection" width="55" align="center" />
            <el-table-column label="ID" align="center" prop="id" />-->
            <el-table-column label="姓名" align="center" prop="params.realName" />
            <el-table-column label="工号" align="center" prop="params.jobNumber" />
            <el-table-column label="退出工会" align="center" prop="params.deptName" />
            <el-table-column label="审核状态" align="center" prop="params.statusName" />
            <el-table-column label="申请时间" align="center" prop="createTime" />
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-set-up"
                  @click="audit1(scope.row)"
                  v-hasPermi="['business:appWithdrawal:auditSecondLaborUnion']"
                  v-if="scope.row.status =='0'"
                >二级工会审核</el-button>
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-s-check"
                  @click="audit1_1(scope.row)"
                  v-hasPermi="['business:appWithdrawal:auditFundCommittee']"
                  v-if="scope.row.status =='2'"
                >基金管委会审核</el-button>
              </template>
            </el-table-column>
          </el-table>
          <pagination
            v-show="totalAppWithdrawal>0"
            :total="totalAppWithdrawal"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getAppWithdrawal"
          />
        </el-tab-pane>

        <el-tab-pane  :label="'转会申请-转出 ('+ totalOutAppTransfer+')'" name="2" v-if="checkPermi(['business:appTransfer:listOut'])">
        <el-table v-loading="loading" :data="outAppTransferList" @selection-change="handleSelectionChange">
          <!--<el-table-column type="selection" width="55" align="center" />
          <el-table-column label="ID" align="center" prop="id" />-->
          <el-table-column label="姓名" align="center" prop="params.realName" />
          <el-table-column label="工号" align="center" prop="params.jobNumber" />
          <el-table-column label="转出工会" align="center" prop="params.deptNameOut" />
          <el-table-column label="转入工会" align="center" prop="params.deptNameInto" />
          <el-table-column label="审核状态" align="center" prop="params.statusName" />
          <el-table-column label="申请时间" align="center" prop="createTime" />
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-s-check"
                @click="audit2(scope.row)"
                v-hasPermi="['business:appTransfer:auditOut']"
                v-if="scope.row.status =='0'"
              >审核</el-button>
            </template>
          </el-table-column>
        </el-table>
        <pagination
          v-show="totalOutAppTransfer>0"
          :total="totalOutAppTransfer"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getOutAppTransfer"
        />
      </el-tab-pane>
        <el-tab-pane  :label="'转会申请-转入 ('+ totalIntoAppTransfer+')'"  name="3" v-if="checkPermi(['business:appTransfer:listInto'])">
          <el-table v-loading="loading" :data="intoAppTransferList" @selection-change="handleSelectionChange">
            <!--<el-table-column type="selection" width="55" align="center" />
            <el-table-column label="ID" align="center" prop="id" />-->
            <el-table-column label="姓名" align="center" prop="params.realName" />
            <el-table-column label="工号" align="center" prop="params.jobNumber" />
            <el-table-column label="转出工会" align="center" prop="params.deptNameOut" />
            <el-table-column label="转入工会" align="center" prop="params.deptNameInto" />
            <el-table-column label="审核状态" align="center" prop="params.statusName" />
            <el-table-column label="申请时间" align="center" prop="createTime" />
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-s-check"
                  @click="audit3(scope.row)"
                  v-hasPermi="['business:appTransfer:auditInto']"
                  v-if="scope.row.status =='2'"
                >审核</el-button>
              </template>
            </el-table-column>
          </el-table>
          <pagination
            v-show="totalIntoAppTransfer>0"
            :total="totalIntoAppTransfer"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getIntoAppTransfer"
          />
        </el-tab-pane>
        <el-tab-pane label="补助申报"  :label="'补助申报 ('+ totalAppSubsidy+')'"  name="4" v-if="checkPermi(['business:appSubsidy:list'])">
          <el-table v-loading="loading" :data="appSubsidyList" @selection-change="handleSelectionChange">
            <el-table-column label="姓名" align="center" prop="params.realName" />
            <el-table-column label="工号" align="center" prop="params.jobNumber" />
            <el-table-column label="工会" align="center" prop="params.deptName" />
            <el-table-column label="审核状态" align="center" prop="params.statusName" />
            <el-table-column label="申报补助年度" align="center" prop="params.medicalFee.zdfpsj" />
            <el-table-column label="公费医疗总金额" align="center" prop="params.medicalFee.zfzfy" />
            <el-table-column label="100%自费金额" align="center" prop="params.medicalFee.qzfblfy" />
            <el-table-column label="自付费总金额" align="center" prop="params.medicalFee.deductible" />
            <el-table-column label="审定自付费总金额" align="center" prop="params.medicalFee.auditedDeductible" />
            <el-table-column label="申请时间" align="center" prop="createTime" width="150"/>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-set-up"
                  @click="audit4(scope.row)"
                  v-hasPermi="['business:appSubsidy:auditSecondLaborUnion']"
                  v-if="scope.row.status =='0'"
                >二级工会审核</el-button>
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-set-up"
                  @click="audit4_1(scope.row)"
                  v-hasPermi="['business:appSubsidy:auditSchoolInfirmary']"
                  v-if="scope.row.status =='2'"
                >校医院审核</el-button>
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-s-check"
                  @click="audit4_2(scope.row)"
                  v-hasPermi="['business:appSubsidy:auditFundCommittee']"
                  v-if="scope.row.status =='4'"
                >基金管委会审核</el-button>
              </template>
            </el-table-column>
          </el-table>
          <pagination
            v-show="totalAppSubsidy>0"
            :total="totalAppSubsidy"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getAppSubsidy"
          />
        </el-tab-pane>
      </el-tabs>
    </template>

    <!-- 入会申请 -->
    <el-dialog :title="title" :visible.sync="open0" width="500px" append-to-body>
      <el-form ref="form" :model="form0"  label-width="80px">
        <el-form-item label="审核状态" prop="status">
          <el-radio-group v-model="form0.status">
            <el-radio label="2">通过</el-radio>
            <el-radio label="1">驳回</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见" prop="remark">
          <el-input v-model.trim="form0.opinion" type="textarea" :rows="4" placeholder="请输入审核意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm0">确 定</el-button>
        <el-button @click="cancel0">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog :title="title" :visible.sync="open0_1" width="500px" append-to-body>
      <el-form ref="form" :model="form0_1" label-width="80px">
        <el-form-item label="审核状态" prop="status">
          <el-radio-group v-model="form0_1.status">
            <el-radio label="3">通过</el-radio>
            <el-radio label="4">驳回</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见" prop="remark">
          <el-input v-model.trim="form0_1.opinion" type="textarea" :rows="4" placeholder="请输入审核意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm0_1">确 定</el-button>
        <el-button @click="cancel0_1">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 退会申请 -->
    <el-dialog :title="title" :visible.sync="open1" width="500px" append-to-body>
      <el-form ref="form" :model="form1"  label-width="80px">
        <el-form-item label="审核状态" prop="status">
          <el-radio-group v-model="form1.status">
            <el-radio label="2">通过</el-radio>
            <el-radio label="1">驳回</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见" prop="remark">
          <el-input v-model.trim="form1.opinion" type="textarea" :rows="4" placeholder="请输入审核意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm1">确 定</el-button>
        <el-button @click="cancel1">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog :title="title" :visible.sync="open1_1" width="500px" append-to-body>
      <el-form ref="form" :model="form1_1" label-width="80px">
        <el-form-item label="审核状态" prop="status">
          <el-radio-group v-model="form1_1.status">
            <el-radio label="3">通过</el-radio>
            <el-radio label="4">驳回</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见" prop="remark">
          <el-input v-model.trim="form1_1.opinion" type="textarea" :rows="4" placeholder="请输入审核意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm1_1">确 定</el-button>
        <el-button @click="cancel1_1">取 消</el-button>
      </div>
    </el-dialog>
  <!--退会申请 转出--->
    <el-dialog :title="title" :visible.sync="open2" width="500px" append-to-body>
      <el-form ref="form" :model="form2"  label-width="80px">
        <el-form-item label="审核状态" prop="status">
          <el-radio-group v-model="form2.status">
            <el-radio label="2">通过</el-radio>
            <el-radio label="1">驳回</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见" prop="remark">
          <el-input v-model.trim="form2.opinion" type="textarea" :rows="4" placeholder="请输入审核意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm2">确 定</el-button>
        <el-button @click="cancel2">取 消</el-button>
      </div>
    </el-dialog>


    <!-- 退会申请 转入 -->
    <el-dialog :title="title" :visible.sync="open3" width="500px" append-to-body>
      <el-form ref="form" :model="form3"  label-width="80px">
        <el-form-item label="审核状态" prop="status">
          <el-radio-group v-model="form3.status">
            <el-radio label="3">通过</el-radio>
            <el-radio label="4">驳回</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见" prop="remark">
          <el-input v-model.trim="form3.opinion" type="textarea" :rows="4" placeholder="请输入审核意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm3">确 定</el-button>
        <el-button @click="cancel3">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 补助申请 -->
    <!-- 二级工会审核对话框 -->
    <el-dialog :title="title" :visible.sync="open4" width="500px" append-to-body>
      <el-form ref="form" :model="form4"  label-width="80px">
        <el-form-item label="审核状态" prop="status">
          <el-radio-group v-model="form4.status">
            <el-radio label="2">通过</el-radio>
            <el-radio label="1">驳回</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见" prop="remark">
          <el-input v-model.trim="form4.opinion" type="textarea" :rows="4" placeholder="请输入审核意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm4">确 定</el-button>
        <el-button @click="cancel4">取 消</el-button>
      </div>
    </el-dialog>

    <!--校医院审核对话框 -->
    <el-dialog :title="title" :visible.sync="open4_1" width="500px" append-to-body>
      <el-form ref="form" :model="form4_1" label-width="80px">
        <el-form-item label="审核状态" prop="status">
          <el-radio-group v-model="form4_1.status">
            <el-radio label="4">通过</el-radio>
            <el-radio label="3">驳回</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见" prop="remark">
          <el-input v-model.trim="form4_1.opinion" type="textarea" :rows="4" placeholder="请输入审核意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm4_1">确 定</el-button>
        <el-button @click="cancel4_1">取 消</el-button>
      </div>
    </el-dialog>

    <!--基金管委会审核对话框 -->
    <el-dialog :title="title" :visible.sync="open4_2" width="500px" append-to-body>
      <el-form ref="form" :model="form4_2" label-width="80px">
        <el-form-item label="审核状态" prop="status">
          <el-radio-group v-model="form4_2.status">
            <el-radio label="5">通过</el-radio>
            <el-radio label="6">驳回</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见" prop="remark">
          <el-input v-model.trim="form4_2.opinion" type="textarea" :rows="4" placeholder="请输入审核意见" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm4_2">确 定</el-button>
        <el-button @click="cancel4_2">取 消</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import { getAppMembership,getAppWithdrawal,getOutAppTransfer,getIntoAppTransfer,getAppSubsidy,
  auditAppMembershipSecondLaborUnion,auditAppMembershipFundCommittee,
  auditAppWithdrawalSecondLaborUnion,auditAppWithdrawalFundCommittee,
  auditOut,auditInto,
  auditAppSubsidySecondLaborUnion,auditAppSubsidySchoolInfirmary,auditAppSubsidyFundCommittee} from "@/api/backlog/backlog";
import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
import auth from '@/plugins/auth'

export default {
  name: "backlog",
  data() {
    return {
      // 遮罩层
      loading: true,
      //tab默认选择值
      activeName: '0',
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      totalAppWithdrawal: 0,
      totalOutAppTransfer: 0,
      totalIntoAppTransfer: 0,
      totalAppSubsidy: 0,
      // 医疗费用质疑记录表格数据
      medicalFeeQueryList: [],
      appWithdrawalList: [],
      outAppTransferList: [],
      intoAppTransferList: [],
      appSubsidyList: [],
      //单位（二级工会）
      deptList:[],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        realName: null,
        jobNumber: null,
        deptId: null,
        status: null
      },
      // 入会申请表单参数
      form0: {
        id: null,
        status: "2",
        opinion: null
      },
      form0_1: {
        id: null,
        status: "3",
        opinion: null
      },
      open0: false,
      open0_1: false,
      // 退会申请表单参数
      form1: {
        id: null,
        status: "2",
        opinion: null
      },
      form1_1: {
        id: null,
        status: "3",
        opinion: null
      },
      open1: false,
      open1_1: false,
      // 转会申请表单参数-转出
      form2: {
        id: null,
        status: "2",
        opinion: null
      },
      open2: false,
      // 转会申请表单参数-转入
      form3: {
        id: null,
        status: "3",
        opinion: null
      },
      open3: false,
      // 补助申请表单参数
      form4: {
        id: null,
        status: "2",
        opinion: null
      },
      form4_1: {
        id: null,
        status: "4",
        opinion: null
      },
      form4_2: {
        id: null,
        status: "5",
        opinion: null
      },
      open4: false,
      open4_1: false,
      open4_2: false,
    };
  },
  created() {
    if(auth.hasPermi('business:appMembership:list')) {
      this.getAppMembership();
    }
    if(auth.hasPermi('business:appWithdrawal:list')) {
      this.getAppWithdrawal();
    }
    if(auth.hasPermi('business:appTransfer:listOut')) {
      this.getOutAppTransfer();
    }
    if(auth.hasPermi('business:appTransfer:listInto')) {
      this.getIntoAppTransfer();
    }
    if(auth.hasPermi('business:appSubsidy:list')) {
      this.getAppSubsidy();
    }

    if(auth.hasPermi('business:appMembership:list')) {
      this.activeName='0';
    }else if(auth.hasPermi('business:appWithdrawal:list')) {
      this.activeName='1';
    }else if(auth.hasPermi('business:appTransfer:listOut')){
      this.activeName='2';
    }else  if(auth.hasPermi('business:appTransfer:listInto')){
      this.activeName='3';
    }else if(auth.hasPermi('business:appSubsidy:list')){
      this.activeName='4';
    }
  },
  methods: {
    checkPermi,
    //tab 切换
    handleClick(tab, event) {
      console.log(tab.name);
      this.activeName=tab.name;
      if(tab.name =="0"){
        this.getAppMembership();
      }
      if(tab.name =="1"){
        this.getAppWithdrawal();
      }
      if(tab.name =="2"){
        this.getOutAppTransfer();
      }
      if(tab.name =="3"){
        this.getIntoAppTransfer();
      }
      if(tab.name =="4"){
        this.getAppSubsidy();
      }
    },
    getAppMembership() {
      this.loading = true;
      getAppMembership(this.queryParams).then(response => {
        this.medicalFeeQueryList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getAppWithdrawal() {
      this.loading = true;
      getAppWithdrawal(this.queryParams).then(response => {
        this.appWithdrawalList = response.rows;
        this.totalAppWithdrawal = response.total;
        this.loading = false;
      });
    },
    getOutAppTransfer() {
      this.loading = true;
      getOutAppTransfer(this.queryParams).then(response => {
        this.outAppTransferList = response.rows;
        this.totalOutAppTransfer = response.total;
        this.loading = false;
      });
    },
    getIntoAppTransfer() {
      this.loading = true;
      getIntoAppTransfer(this.queryParams).then(response => {
        this.intoAppTransferList = response.rows;
        this.totalIntoAppTransfer = response.total;
        this.loading = false;
      });
    },
    getAppSubsidy() {
      this.loading = true;
      getAppSubsidy(this.queryParams).then(response => {
        this.appSubsidyList = response.rows;
        this.totalAppSubsidy = response.total;
        this.loading = false;
      });
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    // 入会申请
    audit0(row) {
      this.reset0();
      const id = row.id;
      this.form0.id=id;
      this.open0 = true;
      this.title = "二级工会审核";
    },
    audit0_1(row) {
      this.reset0_1();
      this.form0_1.id=row.id;
      this.open0_1 = true;
      this.title = "基金管委会审核";
    },
    submitForm0() {
      if(this.form0.status=='1' && (this.form0.opinion ==""|| this.form0.opinion ==null)){
        this.$modal.msgWarning("审核意见不能为空");
        return false;
      }
      auditAppMembershipSecondLaborUnion(this.form0).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.open0 = false;
        this.getAppMembership();
      });
    },
    submitForm0_1() {
      if(this.form0_1.status=='4' && (this.form0_1.opinion ==""|| this.form0_1.opinion ==null)){
        this.$modal.msgWarning("审核意见不能为空");
        return false;
      }
      auditAppMembershipFundCommittee(this.form0_1).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.open0_1 = false;
        this.getAppMembership();
      });
    },
    // 取消按钮
    cancel0() {
      this.open0 = false;
      this.reset0();
    },
    cancel0_1() {
      this.open0_1 = false;
      this.reset0_1();
    },
    reset0() {
      this.form0 = {
        id: null,
        status: "2",
        opinion: null,
      };
      this.resetForm("form0");
    },
    reset0_1() {
      this.form0_1 = {
        id: null,
        status: "3",
        opinion: null,
      };
      this.resetForm("form0_1");
    },
    // 退会申请
    audit1(row) {
      this.reset1();
      const id = row.id;
      this.form1.id=id;
      this.open1 = true;
      this.title = "二级工会审核";
    },
    audit1_1(row) {
      this.reset1_1();
      this.form1_1.id=row.id;
      this.open1_1 = true;
      this.title = "基金管委会审核";
    },
    submitForm1() {
      if(this.form1.status=='1' && (this.form1.opinion ==""|| this.form1.opinion ==null)){
        this.$modal.msgWarning("审核意见不能为空");
        return false;
      }
      auditAppWithdrawalSecondLaborUnion(this.form1).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.open1 = false;
        this.getAppWithdrawal();
      });
    },
    submitForm1_1() {
      if(this.form1_1.status=='4' && (this.form1_1.opinion ==""|| this.form1_1.opinion ==null)){
        this.$modal.msgWarning("审核意见不能为空");
        return false;
      }
      auditAppWithdrawalFundCommittee(this.form1_1).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.open1_1 = false;
        this.getAppWithdrawal();
      });
    },
    // 取消按钮
    cancel1() {
      this.open1 = false;
      this.reset0();
    },
    cancel1_1() {
      this.open1_1 = false;
      this.reset0_1();
    },
    reset1() {
      this.form1 = {
        id: null,
        status: "2",
        opinion: null,
      };
      this.resetForm("form1");
    },
    reset1_1() {
      this.form1_1 = {
        id: null,
        status: "3",
        opinion: null,
      };
      this.resetForm("form1_1");
    },
    // 转会会申请 -转出
    audit2(row) {
      this.reset2();
      const id = row.id;
      this.form2.id=id;
      this.open2 = true;
      this.title = "二级工会审核";
    },
    submitForm2() {
      if(this.form2.status=='1' && (this.form2.opinion ==""|| this.form2.opinion ==null)){
        this.$modal.msgWarning("审核意见不能为空");
        return false;
      }
      auditOut(this.form2).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.open2 = false;
        this.getOutAppTransfer();
      });
    },
    // 取消按钮
    cancel2() {
      this.open2 = false;
      this.reset0();
    },
    reset2() {
      this.form2 = {
        id: null,
        status: "2",
        opinion: null,
      };
      this.resetForm("form2");
    },
    // 转会会申请 -转入
    audit3(row) {
      this.reset3();
      const id = row.id;
      this.form3.id=id;
      this.open3 = true;
      this.title = "二级工会审核";
    },
    submitForm3() {
      if(this.form3.status=='4' && (this.form3.opinion ==""|| this.form3.opinion ==null)){
        this.$modal.msgWarning("审核意见不能为空");
        return false;
      }
      auditInto(this.form3).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.open3 = false;
        this.getIntoAppTransfer();
      });
    },
    // 取消按钮
    cancel3() {
      this.open3 = false;
      this.reset0();
    },
    reset3() {
      this.form3 = {
        id: null,
        status: "3",
        opinion: null,
      };
      this.resetForm("form3");
    },
    // 补助申请
    audit4(row) {
      this.reset4();
      const id = row.id;
      this.form4.id=id;
      this.open4 = true;
      this.title = "二级工会审核";
    },
    audit4_1(row) {
      this.reset4_1();
      this.form4_1.id=row.id;
      this.open4_1 = true;
      this.title = "校医院审核";
    },
    audit4_2(row) {
      this.reset4_1();
      this.form4_2.id=row.id;
      this.open4_2 = true;
      this.title = "基金管委会审核";
    },
    submitForm4() {
      if(this.form4.status=='1' && (this.form4.opinion ==""|| this.form4.opinion ==null)){
        this.$modal.msgWarning("审核意见不能为空");
        return false;
      }
      auditAppSubsidySecondLaborUnion(this.form4).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.open4 = false;
        this.getAppSubsidy();
      });
    },
    submitForm4_1() {
      if(this.form4_1.status=='4' && (this.form4_1.opinion ==""|| this.form4_1.opinion ==null)){
        this.$modal.msgWarning("审核意见不能为空");
        return false;
      }
      auditAppSubsidySchoolInfirmary(this.form4_1).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.open4_1 = false;
        this.getAppSubsidy();
      });
    },
    submitForm4_2() {
      if(this.form4_2.status=='4' && (this.form4_2.opinion ==""|| this.form4_2.opinion ==null)){
        this.$modal.msgWarning("审核意见不能为空");
        return false;
      }
      auditAppSubsidyFundCommittee(this.form4_2).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.open4_2 = false;
        this.getAppSubsidy();
      });
    },
    // 取消按钮
    cancel4() {
      this.open4 = false;
      this.reset4();
    },
    cancel4_1() {
      this.open4_1 = false;
      this.reset4_1();
    },
    cancel4_2() {
      this.open4_2 = false;
      this.reset4_2();
    },
    reset4() {
      this.form4 = {
        id: null,
        status: "2",
        opinion: null,
      };
      this.resetForm("form4");
    },
    reset4_1() {
      this.form4_1 = {
        id: null,
        status: "4",
        opinion: null,
      };
      this.resetForm("form4_1");
    },
    reset4_2() {
      this.form4_2 = {
        id: null,
        status: "5",
        opinion: null,
      };
      this.resetForm("form4_2");
    },





  }
};
</script>
